package paquete ;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Teclado {
	private static final BufferedReader teclado =
		new BufferedReader(new InputStreamReader(System.in));
	
	public static String leeString() {
		String linea = null;
		
		try {
			linea = teclado.readLine();
		}
		catch(IOException e) {
			muestra("Error leyendo una cadena de entrada.");
		}
		
		return linea;
	}
	
	public static int leeEntero() {
		int entero = 0;
		String linea = leeString();
		
		if(linea != null) entero = Integer.parseInt(linea);
		
		return entero;
	}
	
	public static float leeFloat() {
		float real = 0.0f;
		String linea = leeString();
		
		if(linea != null) real = Float.parseFloat(linea);
			
		return real;
	}
	
	public static double leeDouble() {
		double real = 0.0;
		String linea = leeString();
		
		if(linea != null) real = Double.parseDouble(linea);
			
		return real;
	}
	
	private static void muestra(String linea) {
		System.err.println(linea);
	}
}